    <ul class="bg-nav-line">
        <li>
            <a href="#dbconfig">数据库设置</a>
        </li>
        <li>
            <a href="#base">基本设置</a>
        </li>
        <li>
            <a href="#dbtable">创建数据表</a>
        </li>
        <li>
            <a href="#admin">创建管理员</a>
        </li>
        <li>
            <a href="#over">完成安装</a>
        </li>
    </ul>

    <div>&nbsp;</div>

    <div class="alert alert-warning">
        <p>
            <span class="glyphicon glyphicon-warning-sign"></span>
            注意：本接口仅在安装 SSO 时有效，安装成功后将自动失效。
        </p>
        <p>
            “数据库设置”必须在第一步调用，“完成安装”必须在最后一步调用，其余部分推荐按照：基本设置 &gt; 创建数据表 &gt; 创建管理员 的顺序来调用。
        </p>
    </div>

    <a name="dbconfig"></a>
    <h3>数据库设置</h3>

    <p class="text-success">接口说明</p>
    <p>本接口用于设置数据库，本接口必须在第一步调用。</p>

    <p class="text-success">URL</p>
    <p class="text-primary">http://www.domain.com/api/api.php?mod=setup</p>

    <p class="text-success">HTTP 请求方式</p>
    <p>POST</p>

    <p class="text-success">返回格式</p>
    <p>JSON</p>

    <p class="text-success">返回结果是否加密</p>
    <p>否</p>

    <div class="panel panel-default">
        <div class="panel-heading">请求参数</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th class="text-nowrap">必须</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">act</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>接口调用动作，值只能为 dbconfig。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_host</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据库服务器</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_port</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>服务器端口</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_name</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据库名称</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_user</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据库用户名</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_pass</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据库密码</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_charset</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据库字符编码</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">db_table</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>数据表前缀</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <div class="panel panel-default">
        <div class="panel-heading">返回结果</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">rcode</td>
                        <td class="text-nowrap">string</td>
                        <td>返回代码，详情查看 <a href="{BG_URL_HELP}index.php?mod=api&act=rcode">返回代码</a>。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_ver</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本号。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_pub</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本发布时间，格式为年月日。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>返回结果示例</h4>
    <p>
<pre><code class="language-javascript">{
    &quot;prd_sso_ver&quot;: &quot;1.1.1&quot;, //SSO 版本号
    &quot;prd_sso_pub&quot;: 20150923, //SSO 版本发布时间
    &quot;rcode&quot;: &quot;y010102&quot; //返回代码
}</code></pre>
    </p>

    <div>&nbsp;</div>
    <div class="text-right">
        <a href="#top">
            <span class="glyphicon glyphicon-chevron-up"></span>
            top
        </a>
    </div>
    <hr>
    <div>&nbsp;</div>

    <a name="base"></a>
    <h3>基本设置</h3>

    <p class="text-success">接口说明</p>
    <p>本接口用于基本设置。</p>

    <p class="text-success">URL</p>
    <p class="text-primary">http://www.domain.com/api/api.php?mod=setup</p>

    <p class="text-success">HTTP 请求方式</p>
    <p>POST</p>

    <p class="text-success">返回格式</p>
    <p>JSON</p>

    <p class="text-success">返回结果是否加密</p>
    <p>否</p>

    <div class="panel panel-default">
        <div class="panel-heading">请求参数</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th class="text-nowrap">必须</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">act</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>接口调用动作，值只能为 base。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">opt</td>
                        <td class="text-nowrap">array</td>
                        <td class="text-nowrap">true</td>
                        <td>安装参数，详情查看示例。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>安装参数</h4>
    <p>
<pre><code class="language-php">array(
    &quot;opt&quot; =&gt; array(
        &quot;base&quot; =&gt; array(
            &quot;BG_SITE_NAME&quot;        =&gt; &quot;baigo SSO&quot; //站点名称
            &quot;BG_SITE_DOMAIN&quot;      =&gt; &quot;" . $_SERVER["SERVER_NAME"] . "&quot; //域名
            &quot;BG_SITE_URL&quot;         =&gt; &quot;http://" . $_SERVER["SERVER_NAME"] . "&quot; //首页 URL
            &quot;BG_SITE_PERPAGE&quot;     =&gt; 30 //每页显示数
            &quot;BG_SITE_TIMEZONE&quot;    =&gt; &quot;Asia/Shanghai&quot; //时区
            &quot;BG_SITE_DATE&quot;        =&gt; &quot;Y-m-d&quot; //日期格式，等同于 PHP date 函数
            &quot;BG_SITE_DATESHORT&quot;   =&gt; &quot;m-d&quot; //短日期格式，等同于 PHP date 函数
            &quot;BG_SITE_TIME&quot;        =&gt; &quot;H:i:s&quot; //时间格式，等同于 PHP date 函数
            &quot;BG_SITE_TIMESHORT&quot;   =&gt; &quot;H:s&quot; //短时间格式，等同于 PHP date 函数
            &quot;BG_SITE_TPL&quot;         =&gt; &quot;default&quot; //模板
            &quot;BG_ACCESS_EXPIRE&quot;    =&gt; 60; //访问口令存活期，单位：分钟
            &quot;BG_REFRESH_EXPIRE&quot;   =&gt; 60; //刷新口令存活期，单位：天
            &quot;BG_VERIFY_EXPIRE&quot;    =&gt; 30 //验证链接有效期，单位：分钟
        )
    )
);</code></pre>
    </p>

    <div>&nbsp;</div>

    <div class="panel panel-default">
        <div class="panel-heading">返回结果</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">rcode</td>
                        <td class="text-nowrap">string</td>
                        <td>返回代码，详情查看 <a href="{BG_URL_HELP}index.php?mod=api&act=rcode">返回代码</a>。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_ver</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本号。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_pub</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本发布时间，格式为年月日。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>返回结果示例</h4>
    <p>
<pre><code class="language-javascript">{
    &quot;prd_sso_ver&quot;: &quot;1.1.1&quot;, //SSO 版本号
    &quot;prd_sso_pub&quot;: 20150923, //SSO 版本发布时间
    &quot;rcode&quot;: &quot;y010102&quot; //返回代码
}</code></pre>
    </p>

    <div>&nbsp;</div>
    <div class="text-right">
        <a href="#top">
            <span class="glyphicon glyphicon-chevron-up"></span>
            top
        </a>
    </div>
    <hr>
    <div>&nbsp;</div>

    <a name="dbtable"></a>
    <h3>创建数据表</h3>

    <p class="text-success">接口说明</p>
    <p>本接口用于创建数据表。</p>

    <p class="text-success">URL</p>
    <p class="text-primary">http://www.domain.com/api/api.php?mod=setup</p>

    <p class="text-success">HTTP 请求方式</p>
    <p>POST</p>

    <p class="text-success">返回格式</p>
    <p>JSON</p>

    <p class="text-success">返回结果是否加密</p>
    <p>否</p>

    <div class="panel panel-default">
        <div class="panel-heading">请求参数</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th class="text-nowrap">必须</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">act</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>接口调用动作，值只能为 dbtable。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <div class="panel panel-default">
        <div class="panel-heading">返回结果</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">rcode</td>
                        <td class="text-nowrap">string</td>
                        <td>返回代码，详情查看 <a href="{BG_URL_HELP}index.php?mod=api&act=rcode">返回代码</a>。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_ver</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本号。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_pub</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本发布时间，格式为年月日。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>返回结果示例</h4>
    <p>
<pre><code class="language-javascript">{
    &quot;prd_sso_ver&quot;: &quot;1.1.1&quot;, //SSO 版本号
    &quot;prd_sso_pub&quot;: 20150923, //SSO 版本发布时间
    &quot;rcode&quot;: &quot;y010102&quot; //返回代码
}</code></pre>
    </p>

    <div>&nbsp;</div>
    <div class="text-right">
        <a href="#top">
            <span class="glyphicon glyphicon-chevron-up"></span>
            top
        </a>
    </div>
    <hr>
    <div>&nbsp;</div>

    <a name="admin"></a>
    <h3>创建管理员</h3>

    <p class="text-success">接口说明</p>
    <p>本接口用于创建管理员。</p>

    <p class="text-success">URL</p>
    <p class="text-primary">http://www.domain.com/api/api.php?mod=setup</p>

    <p class="text-success">HTTP 请求方式</p>
    <p>POST</p>

    <p class="text-success">返回格式</p>
    <p>JSON</p>

    <p class="text-success">返回结果是否加密</p>
    <p>否</p>

    <div class="panel panel-default">
        <div class="panel-heading">请求参数</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th class="text-nowrap">必须</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">act</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>接口调用动作，值只能为 admin。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">admin_name</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>管理员用户名</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">admin_pass</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>密码，必须用 <mark>MD5</mark> 加密后传输。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <div class="panel panel-default">
        <div class="panel-heading">返回结果</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">rcode</td>
                        <td class="text-nowrap">string</td>
                        <td>返回代码，详情查看 <a href="{BG_URL_HELP}index.php?mod=api&act=rcode">返回代码</a>。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">admin_id</td>
                        <td>int</td>
                        <td>管理员 ID</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_ver</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本号。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_pub</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本发布时间，格式为年月日。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>返回结果示例</h4>
    <p>
<pre><code class="language-javascript">{
    &quot;prd_sso_ver&quot;: &quot;1.1.1&quot;, //SSO 版本号
    &quot;prd_sso_pub&quot;: 20150923, //SSO 版本发布时间
    &quot;admin_id&quot;: &quot;MTA=&quot;, //管理员 ID
    &quot;rcode&quot;: &quot;y010102&quot; //返回代码
}</code></pre>
    </p>

    <div>&nbsp;</div>
    <div class="text-right">
        <a href="#top">
            <span class="glyphicon glyphicon-chevron-up"></span>
            top
        </a>
    </div>
    <hr>
    <div>&nbsp;</div>

    <a name="over"></a>
    <h3>完成安装</h3>

    <p class="text-success">接口说明</p>
    <p>本接口用于通知系统安装已完成，本接口必须在最后一步调用，本接口调用成功后，安装接口将全部失效。</p>

    <p class="text-success">URL</p>
    <p class="text-primary">http://www.domain.com/api/api.php?mod=setup</p>

    <p class="text-success">HTTP 请求方式</p>
    <p>POST</p>

    <p class="text-success">返回格式</p>
    <p>JSON</p>

    <p class="text-success">返回结果是否加密</p>
    <p>否</p>

    <div class="panel panel-default">
        <div class="panel-heading">请求参数</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th class="text-nowrap">必须</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">act</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>接口调用动作，值只能为 over。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">app_name</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>应用名称。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">app_url_notify</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>通知 URL。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">app_url_sync</td>
                        <td class="text-nowrap">string</td>
                        <td class="text-nowrap">true</td>
                        <td>同步 URL。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <div class="panel panel-default">
        <div class="panel-heading">返回结果</div>
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th class="text-nowrap">名称</th>
                        <th class="text-nowrap">类型</th>
                        <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="text-nowrap">rcode</td>
                        <td class="text-nowrap">string</td>
                        <td>返回代码，详情查看 <a href="{BG_URL_HELP}index.php?mod=api&act=rcode">返回代码</a>。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">sso_url</td>
                        <td class="text-nowrap">string</td>
                        <td>SSO API 接口的 URL。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">app_id</td>
                        <td class="text-nowrap">int</td>
                        <td>调用 API 接口所需的 APP ID。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">app_key</td>
                        <td class="text-nowrap">string</td>
                        <td>调用 API 接口所需的 APP KEY。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_ver</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本号。</td>
                    </tr>
                    <tr>
                        <td class="text-nowrap">prd_sso_pub</td>
                        <td class="text-nowrap">string</td>
                        <td>baigo SSO 版本发布时间，格式为年月日。</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div>&nbsp;</div>

    <h4>返回结果示例</h4>
    <p>
<pre><code class="language-javascript">{
    &quot;prd_sso_ver&quot;: &quot;1.1.1&quot;, //SSO 版本号
    &quot;prd_sso_pub&quot;: 20150923, //SSO 版本发布时间
    &quot;app_id&quot;: &quot;MTA=&quot;, //应用 APP ID
    &quot;app_key&quot;: &quot;sfewrw8084382h2r9fdsw9ey5whfDISORwegds&quot;, //应用 APP KEY
    &quot;rcode&quot;: &quot;y010102&quot; //返回代码
}</code></pre>
    </p>
